package cn.wolfcode.domain;

import com.alibaba.fastjson.JSON;
import lombok.*;

import java.util.HashMap;

/**
 * 字典目录
 */
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class SystemDictionary {
    private Long id;

    //目录编码
    private String sn;

    //目录标题
    private String title;

    // 目录简介
    private String intro;

    /**
     * 将字典目录转换成json格式的数据
     *
     * @return
     */
    public String getJson() {
        HashMap<String, Object> jsonObject = new HashMap<>();
        jsonObject.put("id", this.id);
        jsonObject.put("title", this.title);
        jsonObject.put("sn", this.sn);
        jsonObject.put("intro", this.intro);
        return JSON.toJSONString(jsonObject);
    }
}